﻿using System;
using DevExpress.Xpo;

namespace Aij1.Model
{

    public class S_Person : XPObject
    {
        public S_Person(Session session)
            : base(session)
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here.
        }

        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place here your initialization code.
        }

        string fSysName;
        [Size(50)]
        [Indexed(Unique=true)]
        public string SysName
        {
            get { return fSysName; }
            set { SetPropertyValue<string>("SysName", ref fSysName, value); }
        }
        string fTrueName;
        [Size(50)]
        public string TrueName
        {
            get { return fTrueName; }
            set { SetPropertyValue<string>("TrueName", ref fTrueName, value); }
        }
        string fTel;
        [Size(50)]
        public string Tel
        {
            get { return fTel; }
            set { SetPropertyValue<string>("Tel", ref fTel, value); }
        }
        string fMobile;
        [Size(50)]
        public string Mobile
        {
            get { return fMobile; }
            set { SetPropertyValue<string>("Mobile", ref fMobile, value); }
        }
        string fEmail;
        [Size(100)]
        public string Email
        {
            get { return fEmail; }
            set { SetPropertyValue<string>("Email", ref fEmail, value); }
        }
        string fQQ;
        [Size(30)]
        public string QQ
        {
            get { return fQQ; }
            set { SetPropertyValue<string>("QQ", ref fQQ, value); }
        }
        DateTime fBirth;
        public DateTime Birth
        {
            get { return fBirth; }
            set { SetPropertyValue<DateTime>("Birth", ref fBirth, value); }
        }
        int fGender;
        public int Gender
        {
            get { return fGender; }
            set { SetPropertyValue<int>("Gender", ref fGender, value); }
        }

        string fPassword;
        [Size(32)]
        public string Password
        {
            get { return fPassword; }
            set { SetPropertyValue<string>("Password", ref fPassword, value); }
        }

        string fLocation;
        [Size(32)]
        public string Location
        {
            get { return fLocation; }
            set { SetPropertyValue<string>("Location", ref fLocation, value); }
        }

        string fFigureUrl;
        string FigureUrl
        {
            get { return fFigureUrl; }
            set { SetPropertyValue<string>("FigureUrl", ref fFigureUrl, value); }
        }

        [Association("C-E"), Aggregated]
        public XPCollection<S_Edu> Educations
        {
            get { return GetCollection<S_Edu>("Educations"); }
        }

        int fLoginTimes;
        public int LoginTimes
        {
            get { return fLoginTimes; }
            set { SetPropertyValue<int>("LoginTimes", ref fLoginTimes, value); }
        }

        DateTime fLastLoginTime;
        public DateTime LastLoginTime
        {
            get { return fLastLoginTime; }
            set { SetPropertyValue<DateTime>("LastLoginTime", ref fLastLoginTime, value); }
        }

        DateTime fRegisterTime;
        public DateTime RegisterTime
        {
            get { return fRegisterTime; }
            set { SetPropertyValue<DateTime>("RegisterTime", ref fRegisterTime, value); }
        }
    }

}